using System;
using System.Collections.Generic;
using System.Text;

namespace Ghasam.Business.Domain.Entity
{
    public class Invoice
    {

        private int id;
        private Customer customer;
        private string oneTimeCustomer;
        private bool? isFormal;
        private Goods goods;
        private float? grossWeght;
        private float? emptyWeight;
        private float? netWeight;
        private string vehicleNo;
        private PaymentType paymentType;
        private float? unitCost;
        private float? totalPrice;
        private DateTime? invoiceDate;
        private DateTime? lastUpdate;

        public virtual long? Serial { get; set; }

        public virtual String OfficialSerial {
            get {
                if (Revision == 1)
                    return Serial.ToString();

                return (Serial.ToString() + "/" + Revision);
            }
        }

        public virtual int? Revision { get; set; }

        public virtual DateTime? LastUpdate
        {
            get { return lastUpdate; }
            set { lastUpdate = value; }
        }

        public virtual DateTime? InvoiceDate
        {
            get { return invoiceDate; }
            set { invoiceDate = value; }
        }

        public virtual float? TotalPrice
        {
            get { return totalPrice; }
            set { totalPrice = value; }
        }

        public virtual float? UnitCost
        {
            get { return unitCost; }
            set { unitCost = value; }
        }

        public virtual PaymentType PaymentType
        {
            get { return paymentType; }
            set { paymentType = value; }
        }

        public virtual string VehicleNo
        {
            get { return vehicleNo; }
            set { vehicleNo = value; }
        }

        public virtual float? NetWeight
        {
            get { return netWeight; }
            set { netWeight = value; }
        }

        public virtual float? EmptyWeight
        {
            get { return emptyWeight; }
            set { emptyWeight = value; }
        }

        public virtual float? GrossWeight
        {
            get { return grossWeght; }
            set { grossWeght = value; }
        }

        public virtual Goods Goods
        {
            get { return goods; }
            set { goods = value; }
        }

        public virtual bool? IsFormal
        {
            get { return isFormal; }
            set { isFormal = value; }
        }

        public virtual string OneTimeCustomer
        {
            get { return oneTimeCustomer; }
            set { oneTimeCustomer = value; }
        }

        public virtual Customer Customer
        {
            get { return customer; }
            set { customer = value; }
        }

        public virtual int Id
        {
            get { return id; }
            set { id = value; }
        }

        public virtual string CustomerName
        {
            get {
                if (this.Customer != null)
                    return this.Customer.CustomerName;
                else
                    return oneTimeCustomer;
            }
        }

        public virtual string GoodsName
        {
            get { return this.Goods.Name; }
        }
	
    }
}
